<script setup lang="ts">
import type { CategoryItem } from '@/types/home'

// 使用props接收父组件传递的数据
defineProps<{
    list: CategoryItem[]
}>()
</script>

<template>
    <view class="category">
        <navigator class="category-item" hover-class="none" url="/pages/index/index" v-for="item in list" :key="item.id">
            <image class="icon" :src="item.icon">
            </image>
            <text class="text">{{ item.name }}</text>
        </navigator>
    </view>
</template>

<style lang="scss">
/* H5端默认开启scoped样式隔离, 导致组件基础样式无效 */
@import './styles/CategoryPanel.scss';
</style>